// JavaScript Document

window.onload=function()
{
	 
	//表格鼠标经过行间变色
	var oTable=document.getElementById('table');
	if(oTable!=null){
		for(var i=0;i<oTable.tBodies[0].rows.length;i++)
	     {
	         oTable.tBodies[0].rows[i].onmouseover=function()
	         {
	             oldcolor=this.style.background;
	             oldfontcolor=this.style.color;  //把当前行的颜色赋给变量
	             this.style.background='#0075c5';
				 this.style.color='#fff';
				 oTable.tBodies[0].rows[0].style.background='#fe6d7f';
	         };
	         
	         oTable.tBodies[0].rows[i].onmouseout=function()
	         {
	             this.style.background=oldcolor;
	             this.style.color=oldfontcolor;
	         };
	         
			 //隔行变色
	         if(i%2){
	             oTable.tBodies[0].rows[i].style.background='#fffaf8';
	         }
	         else{
	             oTable.tBodies[0].rows[i].style.background='';    
	         }
	     }; 
	}

	 
	 //翻页按钮鼠标经过变色
	 var Page=document.getElementById('page');
	 if(Page!=null){
		 var page_Btn=getByClass(Page, 'page_btn');  
		 for( var i=0;i<page_Btn.length; i++)
		 {
			page_Btn[i].onmouseover=function()
			{
				Oldcolor=this.style.background;
				Oldfontcolor=this.style.color;
				this.style.background='#005e9c';
				this.style.color='#fff';
			}; 
			
			page_Btn[i].onmouseout=function()
			{
				this.style.background=Oldcolor;
				this.style.color=Oldfontcolor;
			}; 
		 };
	 }

	 
	 //菜单栏鼠标点击变色
	 var ul_Menu=document.getElementById('ul_menu');
	 var aLi=ul_Menu.getElementsByTagName('li');  //一级菜单背景切换
	 var Ul_Menu_2=getByClass(ul_Menu, 'ul_menu_2');  //二级菜单全选
	 var Arrow_Img=getByClass(ul_Menu, 'arrow_img');  //一级菜单小图标获
	 var sPan=ul_Menu.getElementsByTagName('span');  //获取一级二级菜单span
	 
	 //一级菜单点击变白色
	for(var i=0; i<sPan.length; i++)
	{
		sPan[i].className='to_blue';
		sPan[i].onclick=function()
		{
		    if(this.className=='to_blue')
			{
				this.className='to_white'; 
			}
			else
			{
				this.className='to_blue'; 
			};
	    };
	};
	 
	 
	 for(var i=0; i<aLi.length; i++)
	 {
		 aLi[i].index=i;
		 
		 aLi[i].onclick=function()
		 {
			 if(this.style.backgroundPosition=='-67px 0px')
			 {
				 this.style.backgroundPosition='-237px 0px';
				 Ul_Menu_2[this.index].style.display='';
				 Arrow_Img[this.index].style.backgroundPosition='';
			 }
			 else
			 {
				 this.style.backgroundPosition='-67px 0px';
				 Ul_Menu_2[this.index].style.display='block';
				 Arrow_Img[this.index].style.backgroundPosition='0px -31px';
			 };
		 };
		 
		 //一级菜单鼠标经过图标变白色
		 aLi[i].onmouseover=function()
		 {
			 if(this.style.backgroundPosition=='-67px 0px')
			 {
				 Arrow_Img[this.index].style.backgroundPosition='-17px -31px';
			 }
			 else
			 {
				 Arrow_Img[this.index].style.backgroundPosition='';
			 }
			
		 };
		 
		 aLi[i].onmouseout=function()
		 {
			if(this.style.backgroundPosition=='-67px 0px')
			 {
				 Arrow_Img[this.index].style.backgroundPosition='0px -31px';
			 }
			 else
			 {
				 Arrow_Img[this.index].style.backgroundPosition='';
			 };
		 };
		 
		 
	 };
	

};
